package com.ksd.pojo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

@Entity
public class Worklog {
    private int id;
    private String username;
    private Integer year;
    private Integer month;
    private Integer day;
    private String title;
    private String description;
    private String logtime;

    @Id
    @Column(name = "ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "year")
    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    @Basic
    @Column(name = "month")
    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    @Basic
    @Column(name = "day")
    public Integer getDay() {
        return day;
    }

    public void setDay(Integer day) {
        this.day = day;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "logtime")
    public String getLogtime() {
        return logtime;
    }

    public void setLogtime(String logtime) {
        this.logtime = logtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Worklog worklog = (Worklog) o;
        return id == worklog.id &&
                Objects.equals(username, worklog.username) &&
                Objects.equals(year, worklog.year) &&
                Objects.equals(month, worklog.month) &&
                Objects.equals(day, worklog.day) &&
                Objects.equals(title, worklog.title) &&
                Objects.equals(description, worklog.description) &&
                Objects.equals(logtime, worklog.logtime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, year, month, day, title, description, logtime);
    }
}
